import Vue from 'vue'
import VueRouter from 'vue-router'
import Start from '../views/Start/Start.vue'
import Login from '../views/Login/Login.vue'
import Register from '../views/Register/Register.vue'
import Question from '../components/Question/Question.vue'
import Content from '../components/Content/Content.vue'
import Myspace from '../components/Myspace/Myspace.vue'
import Myinformation from '../components/Myinformation/Myinformation.vue'
import Manage from '../components/Manage/Manage.vue'
Vue.use(VueRouter)
const routes = [
  {
    // 重定向
    path: '/',
    redirect: '/Start'
  },
  {
    path: '/Start',
    name: 'Start',
    title: '首页',
    component: Start,
  },
  {
    path: '/Login',
    name: 'Login',
    component: Login
  },
  {
    path: '/Register',
    name: 'Register',
    component: Register
  },
  {
    path: '/Question',
    name: 'Question',
    component: Question,
    meta: {
      requireAuth: true // 标识该路由是否需要登录
    }
  },
  {
    path: '/Content',
    name: 'Content',
    component: Content,
    meta: {
      requireAuth: true // 标识该路由是否需要登录
    }
  },
  {
    path: '/Myspace',
    name: 'Myspace',
    component: Myspace,
    meta: {
      requireAuth: true // 标识该路由是否需要登录
    }
  },
  {
    path: '/Myinformation',
    name: 'Myinformation',
    component: Myinformation,
    meta: {
      requireAuth: true // 标识该路由是否需要登录
    }
  },
  {
    path: '/Manage',
    name: 'Manage',
    component: Manage,
    meta: {
      requireAuth: true // 标识该路由是否需要登录
    }
  },

]


const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
